package com.leeon.exception.exmaples;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.logging.Logger;

public class Example7 {

    public static Logger logger = Logger.getLogger("example7");

    public static void main(String[] args) {
        String[] arr = new String[5];
        try {
            System.out.printf("arr[5] : " + arr[7]);
        }catch (ArrayIndexOutOfBoundsException e){
            StringWriter trace = new StringWriter();
            e.printStackTrace(new PrintWriter(trace));
            logger.severe(trace.toString());
        }
    }

}
